package com.mjlf.mr.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @ClassName: DateFormat
 * @Author: majun
 * @CreateDate: 2018/12/18 11:25
 * @Version: 1.0
 * @Description: TODO
 */

public final class DateFormat {
    public static  final Date parse(String time, String pattern) throws ParseException {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
        return simpleDateFormat.parse(time);
    }

    public final static String format(Date date, String pattern){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
        return simpleDateFormat.format(date);
    }
}
